
import VueRouter from 'vue-router'
import Vue from 'vue'

Vue.use(VueRouter)

import Home from '../components/tabbars/HomeContainer.vue'
import Member from '../components/tabbars/MemberContainer.vue'
import Search from '../components/tabbars/SearchContainer.vue'
import Cart from '../components/tabbars/ShopCartContainer.vue'
import NewList from '../components/new/NewList.vue'
import NewInfo from '../components/new/NewInfo.vue'
import SharePhote from '../components/sharephotes/SharePhote.vue'
import PhotoInfo from '../components/sharephotes/PhotoInfo.vue'
import GoodsList from '../components/goods/GoodsList.vue'
import GoodsDetail from '../components/goods/GoodsDetail.vue'
import GoodsDesc from '../components/goods/GoodsDesc.vue'
import GoodsComment from '../components/goods/GoodsComment.vue'

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/member', component: Member },
    { path: '/cart', component: Cart },
    { path: '/search', component: Search },
    { path: '/home/newslist', component: NewList },
    { path: '/home/newsinfo/:id', component: NewInfo, props: true }, // 开启props接收路由参数
    { path: '/home/sharephote', component: SharePhote },
    { path: '/home/photoinfo/:id', component: PhotoInfo, props: true },
    { path: '/home/goodslist', component: GoodsList },
    { path: '/home/goodsdetail/:id', component: GoodsDetail, props: true },
    { path: '/home/goodsdesc/:id', component: GoodsDesc, props: true },
    { path: '/home/goodscomment/:id', component: GoodsComment, props: true },
  ],
  linkActiveClass: 'mui-active'   //  激活添加类名, mui-active  MUI 激活类名
})

export default router